<?php
/**
 * @author 段志岩
 * @date 2008.9.3
 * @summary 取得各论坛的前几个帖子
 */

class PostView extends View{
	private $number;
	private $order;
	
	public function __construct()
	{
		parent::__construct();

		$this->sql = "SELECT u.truename, posts.*
			FROM posts, users as u ";
	}
	protected function _preParse()
	{
		$this->where .= " posts.author_id = u.uid AND ";
	}
	protected function _afterParse()
	{
		$this->where .= " ORDER BY `time` desc";
	}
	public function setNumber($number)
	{
		$this->number = (int)($number -1);
	}
	public function toSql()
	{
		return $this->sql . $this->parseWhere();
	}
};
?>
